﻿namespace Wiki.IO
{
    using System;
    using System.IO;

    public static class StreamExtensionMethods
    {
        public static string ReadString(this Stream arg)
        {
            string obj = null;

            if ((arg != null) && arg.CanRead)
            {
                using (StreamReader reader = new StreamReader(arg))
                {
                    obj = reader.ReadToEnd();
                }
            }

            return obj;
        }

    }
}